#pragma once
#include <vector>
#include <string>
#include "Equipment.h"
#include "Skill.h"
#include "json.hpp"
#include "Character.h"
#include <windows.h>

struct User {
    std::string id;
    std::string password;
    bool isAdmin;
};
class FileManager {
public:
    

    static std::vector<User> loadUsers(const std::string& filename);

    // 加载装备库
    static std::vector<Equipment> loadEquipmentLibrary(const std::string& filename);

    // 加载技能库
    static std::vector<Skill> loadSkillLibrary(const std::string& filename);

    static std::vector<Monster> loadMonsterLibrary(const std::string& filename);

    static bool saveEquipmentLibrary(const std::string& filename, const std::vector<Equipment>& equipmentList);
    static bool saveSkillLibrary(const std::string& filename, const std::vector<Skill>& skillList);
    static bool saveMonsterLibrary(const std::string& filename, const std::vector<Monster>& monsterList);

    // 保存游戏状态
    static bool saveGameState(const std::string& filename,
        const Character& player,
        const std::vector<Monster>& monsters,
        int currentMonsterIndex);

    // 加载游戏状态
    static bool loadGameState(const std::string& filename,
        Character*& player,
        std::vector<Monster>& monsters,
        int& currentMonsterIndex);

    // 创建目录（如果不存在）
    static void createDirectoryIfNotExists(const std::string& path);


    

};

